/*
 * SoapHelper.cpp
 *
 *  Created on: Feb 24, 2011
 *      Author: DoanDung
 */

#include "SoapHelper.h"
#include <conprint.h>

static String sSoapHeader =
		"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
		"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
		"<soap:Body>";
static String sSoapFooter =
		"</soap:Body>"
		"</soap:Envelope>";

//Lottery Session
String GOI_GetList(){
	String output;
	output.clear();
	String data = "<GetSubscriptionList xmlns=\"http://tempuri.org/\" />";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

//Lottery Session
String SH_LotProvinces(){
	String output;
	output.clear();
	String data = "<GetLotteryCompany xmlns=\"http://tempuri.org/\" />";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_LotInfo(String& companyid){
	String output;
	output.clear();
	String data = "<GetLotteryInfo xmlns=\"http://tempuri.org/\"><companyId>" + companyid + "</companyId></GetLotteryInfo>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_LotResult(){
	String output;
	output.clear();
	String data = "<GetLotteryResult xmlns=\"http://tempuri.org/\" />";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_LotSoicauResult(){
	String output;
	output.clear();
	String data = "<GetSoiCauResult xmlns=\"http://tempuri.org/\" />";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_Lot2DigitsStatitics(String& companyid, String& isspecial){
	String output;
	output.clear();
	String data = "<Get2DigitsStatitics xmlns=\"http://tempuri.org/\"><CompanyId>1</CompanyId><IsSpecial>1</IsSpecial></Get2DigitsStatitics>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_Lot2DigitsAnalysis(String& companyid, String& digits, String& isspecial){
	String output;
	output.clear();
	String data = "<Get2RandomDigitsAnalysis xmlns=\"http://tempuri.org/\"><CompanyId>" + companyid + "</CompanyId><Digits>" + digits + "</Digits><IsSpecial>" + isspecial + "</IsSpecial></Get2RandomDigitsAnalysis>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	//lprintfln(output.c_str());
	return output;
};

String SH_LotBridgeDetail(String& id){
	String output;
	output.clear();
	String data = "<bridgeDetail xmlns=\"http://tempuri.org/\"><id>" + id + "</id></bridgeDetail>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_LotFecthGerm(String& companyid){
	String output;
	output.clear();
	String data = "<fecthGerm xmlns=\"http://tempuri.org/\"><compantId>" + companyid + "</compantId></fecthGerm>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_LotFecthGermByResult(String& companyid, String& result){
	String output;
	output.clear();
	String data = "<fecthGermByResult xmlns=\"http://tempuri.org/\"><compantId>" + companyid + "</compantId><result>" + result + "</result></fecthGermByResult>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

//Football Session
String SH_FB87Content(String& serviceid){
	String output;
	output.clear();
	String data = "<Get87Content xmlns=\"http://tempuri.org/\"><ServicesID>" + serviceid + "</ServicesID></Get87Content>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_FB87ServiceList(){
	String output;
	output.clear();
	String data = "<Get87ServicesList xmlns=\"http://tempuri.org/\"><pageSize>20</pageSize><pageNumber>1</pageNumber></Get87ServicesList>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_FBLeagueList(){
	String output;
	output.clear();
	String data = "<GetSportLeagueList xmlns=\"http://tempuri.org/\" />";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_FBSchedule(String& leagueid, String& pagesize, String& pagenum){
	String output;
	output.clear();
	String data = "<GetSchedule xmlns=\"http://tempuri.org/\"><competitionId>" + leagueid + "</competitionId><pageSize>" + pagesize + "</pageSize><pageNumber>" + pagenum +"</pageNumber></GetSchedule>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_FBFixturesByLeagueId(String& leagueid){
	String output;
	output.clear();
	String data = "<GetFixturesByLeagueld xmlns=\"http://tempuri.org/\"><CompetitionID>" + leagueid + "</CompetitionID></GetFixturesByLeagueld>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_FBMatchInfo(String& matchid){
	String output;
	output.clear();
	String data = "<GetMatchInfo xmlns=\"http://tempuri.org/\"><MatchID>" + matchid + "</MatchID></GetMatchInfo>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};

String SH_FBSpecialComment(String& matchid){
	String output;
	output.clear();
	String data = "<GettspecialListComment xmlns=\"http://tempuri.org/\"><MatchID>" + matchid + "</MatchID></GettspecialListComment>";
	output.append(sSoapHeader.c_str(), sSoapHeader.length());
	output.append(data.c_str(), data.length());
	output.append(sSoapFooter.c_str(), sSoapFooter.length());
	return output;
};
